#! /bin/bash

VALA_VERSION=@VALA_VERSION@

function backup {
	for i in $*; do
		cp -p $i .$i.bak
	done;
}
function check_restore {
	for i in $*; do
		if cmp $i .$i.bak; then
			cp -p .$i.bak $i;
		fi;
		rm -f .$i.bak
	done;
}
function patch {
	edit=$1;
	shift;
	for i in $*; do
		echo -n patching $i with $edit ...
		if ! sed -e "$edit" $i > $i.new; then
			echo failed.
		else
			if cmp $i $i.new; then
				echo noting was done.
				exit 1;
			else 
				echo OK.
			fi;
		fi
		mv $i.new $i; 
	done;
}

